package com.itchu.upload.controller;


import com.itchu.upload.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/api")
public class UploadController {

    @Autowired
    private UploadService uploadService;

    /**
     *
     * @return
     */
    @GetMapping("/signature")
    public ResponseEntity<Map<String,Object>> getAliOssSignature(@RequestParam("type") String type) {
        Map<String,Object> map = uploadService.getAliOssSignature(type);
        return ResponseEntity.ok(map);
    }
}
